package com.net.oil.widget;

import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

/**
 * 作者：lch
 * 时间：2019/6/18 0018:下午 21:01
 * 邮箱：245850413@qq.com
 * 说明：修复 Can not perform this action after onSaveInstanceState 异常，因为要用到 mDismissed mShownByMe
 * 两个属性，所以要和support v4包名相同
 */
public class DialogFragmentChange  extends DialogFragment {

    /**
     * 复写 DialogFragment 中的show方法，
     * @param manager   manager
     * @param tag   tag
     */
    @Override
    public void show(FragmentManager manager, String tag) {
        FragmentTransaction ft = manager.beginTransaction();
        ft.add(this, tag);
        // 这里吧原来的commit()方法换成了commitAllowingStateLoss()
        ft.commitAllowingStateLoss();
    }
}
